<?php

namespace Home\Controller;

use Think\Controller;
use Home\Model as Model;

class IndexController extends Controller {

    public function index() {
        //$this->show('Hello World !', 'utf-8');
        $this->display('Search');
    }

    public function helloMe() {
        echo 'Hello Me !';
    }

    public function randomUser() {
        $user = new Model\User();
        var_dump($user->getInfoByRandom());
    }

    public function randomUserHtml() {
        $user = new Model\User();
        $randomUser = $user->getInfoByRandom();
        $this->assign('user', $randomUser);
        $this->display('Index');
    }

    public function randomUserHtml2() {
        $user = new Model\User();
        $randomUser = $user->getInfoByRandom();
        $this->assign(array('user' => $randomUser));
        $this->display('Index');
    }

}
